<?php
/**
 * 2012.7.6
 * @author uther,tjb
 *
 */
class m_report extends CI_Model {

	var $table = 'tbk_report';
    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }
    
	function insert_report($report)
    {
    	return $this->db->insert_batch('tbk_report',$report);
    }
    
	function insert_one_report($report)
    {
        return $this->db->insert('tbk_report', $report);
    }

    function view_report()
    {
    	$this->db->select('*');
		$res = $this->db->get($this->table);
    	if($res->num_rows>0){
    		return $res->result();
    	}
    	else{
    		return false;
    	}
    }
    
    function query_report($date)
    {
    	$res = $this->db->get_where('tbk_report',array('report_date'=>$date));
    	if($res->num_rows>0){
    		return false;
    	}
    	else{
    		return true;
    	}
    }
}